;;========== hl-line
(require 'hl-line)
;;(hl-line-mode -1)
;;(global-hl-line-mode -1)
;; for hight line mode
(or (facep 'my-hl-line-face) (make-face 'my-hl-line-face))
(setq hl-line-face 'my-hl-line-face)
(face-spec-set 'my-hl-line-face '((t (
                                      :background "DodgerBlue3"
                                                  ;;:bold
                                                  ;;:weight nil
                                      :inverse-video nil
                                      ))))
(defun color-theme-adjust-hl-mode-face()
  "interactive"
  (let* ((color  (x-color-values (face-attribute 'default :background))))
    (if (null color)
        (error "not support.")
      (let ((my-color (mapcar
                       (lambda (x)
                         (let ((y (/ #XFFFF 4))
                               (delta #X18FF))
                           (cond
                            ((< x (* y 1))
                             (+ x delta))
                            ((< x (* y 2))
                             (+ x delta))
                            ((< x (* y 3))
                             (- x delta))
                            (t
                             (- x delta)))))
                       color)))
        (message "%S %S" color my-color)
        (set-face-attribute
         'my-hl-line-face nil
         :background
         (concat "#"
                 (mapconcat
                  (lambda (c) (format "%04X" c))
                  my-color
                  "")))))))
(color-theme-adjust-hl-mode-face)


;;---------- 
(require 'rect-mark)

;;---------- setnu
(require 'setnu)

;;---------- RST
(require 'rst)
(add-hook 'text-mode-hook 'rst-text-mode-bindings)


(setq auto-mode-alist
      (append '(("\\.rst$" . rst-mode)
                 ("\\.rest$" . rst-mode)) auto-mode-alist))

(add-hook 'rst-adjust-hook 'rst-toc-insert-update)

;;========== buffer name
(load "shell-buffer.el")

;;---------- tabbar
(require 'tabbar)
(tabbar-mode)
(global-set-key (kbd "M-{") 'tabbar-backward-group)
(global-set-key (kbd "M-}") 'tabbar-forward-group)
(global-set-key (kbd "M-[") 'tabbar-backward-tab)
(global-set-key (kbd "M-]") 'tabbar-forward-tab)
(global-set-key (kbd "C-!") 'tabbar-backward)
(global-set-key (kbd "C-~") 'tabbar-forward)
;; 新建default组
(load "tabbar-group")


;;--------- jde
;; Set the debug option to enable a backtrace when a    
;; problem occurs.    
;; 当有问题出现显示错误信息，便于调试    
(setq debug-on-error t)    
;; Update the Emacs load-path to include the path to    
;; the JDE and its require packages. This code assumes    
;; that you have installed the packages in the emacs/site    
;; subdirectory of your home directory.    
;; 加载所需的package    
(progn
  (autoload 'java-mode "java" "JAVA mode." nil)
  (setq auto-mode-alist
		(append
		 '(("\\.bream\\'" . java-mode))
		 auto-mode-alist))
  )
;; If you want Emacs to defer loading the JDE until you open a    
;; Java file, edit the following line    
;; 不自动加载jde-mode    
(setq defer-loading-jde t)
;; to read:    
;;  (setq defer-loading-jde t)    
;; 编辑.java文件时加载jde    
;(if defer-loading-jde    
;    (progn    
;      (autoload 'jde-mode "jde" "JDE mode." nil)    
;      (setq auto-mode-alist    
;           (append    
;            '(("\\.java\\'" . jde-mode))    
;            auto-mode-alist))
     ;;(setq auto-mode-alist
     ;;      (append
     ;;       '(("\\.bream\\'" . jde-mode))
     ;;       auto-mode-alist))
     ;;(setq jde-enable-abbrev-mode t)
;   )
;; 设置局部快捷键  
; (define-key jde-mode-map (kbd "C-c C-v g m") 'jde-gen-main-method)  
; (define-key jde-mode-map (kbd "C-c C-v g p") 'jde-gen-println)  
; (define-key jde-mode-map (kbd "C-c C-v g C") 'jde-gen-class)  
; (define-key jde-mode-map (kbd "C-c C-v g c") 'jde-gen-inner-class)  
; (define-key jde-mode-map (kbd "C-c C-v g a l") 'jde-gen-action-listener)  
; (define-key jde-mode-map (kbd "C-c C-v g m l") 'jde-gen-mouse-listener)  
; (define-key jde-mode-map (kbd "C-c C-v g w l") 'jde-gen-window-listener)
  
;;set the variable
; (setq jde-web-browser "opera")
; (setq jde-db-set-source-paths "/opt/jdk1.6.0_37/src")
; '(jde-jdk-registry (quote (("1.6" . "/home/ryu/emacs/site/jdk1.7.0_06"))))
; (require 'jde)
;)


;;(setq jde-doc-dir "/opt/jdk1.6.0_37")

;;(setq jde-jdk-registry (quote (("1.6" . "/opt/jdk1.6.0_37"))))
;;(message jde-jdk-registry)

